package com.itany.cloud.util;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @author 石小俊
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class ResponseResult {
    private String responseCode;
    private String message;
    private Object returnObject;

    public static ResponseResult success() {
        ResponseResult result = new ResponseResult();
        result.setResponseCode("2001");
        result.setMessage("成功");
        return result;
    }

    public static ResponseResult success(String message) {
        ResponseResult result = new ResponseResult();
        result.setResponseCode("2001");
        result.setMessage(message);
        return result;
    }

    public static ResponseResult success(Object returnObject) {
        ResponseResult result = new ResponseResult();
        result.setResponseCode("2001");
        result.setMessage("成功");
        result.setReturnObject(returnObject);
        return result;
    }

    public static ResponseResult success(String message,Object returnObject) {
        ResponseResult result = new ResponseResult();
        result.setResponseCode("2001");
        result.setMessage(message);
        result.setReturnObject(returnObject);
        return result;
    }

    public static ResponseResult fail(String message){
        ResponseResult result = new ResponseResult();
        result.setResponseCode("2002");
        result.setMessage(message);
        return result;
    }
}
